<template>
  <el-dialog
    :title="title"
    :visible.sync="show"
    width="width"
    @close="remove"
    center
    append-to-body
    v-dialogDrag="drag"
  >
        <component
      v-bind:is="component"
      @close="callback"
      :pdata="data"
    ></component>

  </el-dialog>
</template>

<script>
export default {
  data() {
    return {
      show: false,
      drag:true,
      title: "",
      component: "",
      data: null,
      width: "520px",
      close:()=>{}
    };
  },
  methods: {
    callback(data) {
      this.show=false;
      this.close(data);
    },
    //动画完毕后删除该窗口
    remove(data) {
      let el = this.$el;
      el.parentNode.removeChild(el);
    }
  }
};
</script>

<style lang="scss" scoped>
</style>
